package com.dgut.cbd.result;

import lombok.Data;
import lombok.experimental.Accessors;


/**
 * @Program: exp3
 * @Description:
 * @Author: cbd
 * @Create: 2021-05-13
 * @Version: 1.0.0
 **/
@Data
@Accessors(chain = true)
//不用枚举了,需要什么自定义错误用静态变量实现吧
public class  RO implements R {
    int code;

    String msg;

    Object data;

    public static R SUCCESS_MSG = new RO(200,"success");


    RO(int _code,String _msg){
        code=_code;
        msg=_msg;
    }
    RO(int _code, String _msg, Object _data){
        code=_code;
        msg=_msg;
        data=_data;
    }

    public static RO success(){
        return new RO(200,"success");
    }

    public static RO success(Object _data){
        return success().setData(_data);
    }
}
